<template>
	<text :class="[type,'iconfont-' + name,{'nmr-linear':islinear}]" :style="{'background-image':islinear?linearStyle:'',color: color,'line-height':size + 'rpx', 'font-size': size + 'rpx' }"
	 @click="_onClick" />
</template>

<script>
	// 组件使用方法
	// <nmr-icon name="renwu" size="30" color="#ff0000"></nmr-icon>
	export default {
		name: 'UniIcon',
		props: {
			type: {
				type: String,
				default: 'appletB'
			},
			islinear: {//是否渐变图标
				type: Boolean,
				default: false,
			},
			linearStyle: {//渐变样式
				type: String,
				default: 'linear-gradient(180deg, #FD7F21 0%, #FDC472 100%)'
			},
			name: {
				type: String,
				default: ''
			},
			color: {
				type: String,
				default: '#333333'
			},
			
			size: {
				type: [Number, String],
				default: 32
			}
		},
		methods: {
			_onClick() {
				this.$emit('click')
			}
		}
	}
</script>
<style>
	.nmr-linear{
		       -webkit-background-clip: text;
			   background-clip: text;
		       color: transparent !important;
		       background-image:  linear-gradient(180deg, #64BDE7 0%, #A7D9F3 100%);
	}
</style>
